﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StudentSys.Models

{
    /// <summary>
    /// 学生
    /// </summary>
    public class Student : BaseEntity
    {
        /// <summary>
        /// 姓名
        /// </summary>
        [Required]
        public String Name { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        /// 

        [Required]
        public String sex { get; set; }

        /// <summary>
        /// 出生日期
        /// </summary>
        public DateTime BornDate { get; set; }
        public string Phone { get; set; }
        public string QQ { get; set; }
        public String Email { get; set; }
        /// <summary>
        /// 图片路径
        /// </summary>
        public string ImagePath { get; set; }

        /// <summary>
        /// 班级编号，并且与班级表进行关联
        /// 值类型为空必须加”？“
        /// </summary>
        [ForeignKey(nameof(Class))]
        public Guid? ClassId { get; set; }

        public Class Class { get; set; }
    }
}
